package com.example.ziru.service.impl;

import com.example.ziru.entity.Tenant;
import com.example.ziru.mapper.TenantMapper;
import com.example.ziru.service.TenantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TenantServiceImpl implements TenantService {
    @Autowired
    private TenantMapper tenantMapper;

    //登录
    @Override
    public Tenant selectBytPhone(String tPhone) {
        return tenantMapper.selectBytPhone(tPhone);
    }

    @Override
    public int reg(String tNickname, String tPhone, String tPassword1) {
        Tenant tenant = new Tenant();
        tenant.setTNickname(tNickname);
        tenant.setTPhone(tPhone);
        tenant.setTPassword(tPassword1);
        return tenantMapper.reg(tenant);
    }
}
